package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-08-28 14:13
 */
public class Test01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int score, sum=0, avg = 0;
        for (int i = 1; i <= 3; i++) {
            //统计每个班的总分和平均分,累加总分变量归零
            sum=0;
            for (int j = 1; j <= 3; j++) {
                System.out.println("输入第" + i + "个班，第" + j + "名同学的成绩");
                score = sc.nextInt();
                sum += score;
            }
            avg = sum/3;
            System.out.println("sum=" + sum);
            System.out.println("avg=" + avg);
        }

    }
}
